package com.ssy.lingxi.sms.repository;

import com.ssy.lingxi.sms.entity.Template;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 短信模板持久化层
 * @author jw.chen
 * @version 2.0.0
 * @date 2020/6/11
 */
public interface TemplateRepository extends JpaRepository<Template,Long>, JpaSpecificationExecutor<Template> {

     @Transactional
     void deleteTemplateById(Long id);

     List<Template> findByCode(String code);

     Template findFirstByCode(String code);
}
